var app = angular.module("app", ["ui.router"]);
app.controller("my", function ($scope, $http) {
    $http.get("data.json").then(function (data) {
        $scope.one = data.data.dom1_a[0];
        $scope.two = data.data.dom1_b;
        $scope.three = data.data.dom2;
        console.log($scope.three)
    });
    $scope.show = function (index) {
        // for( i in $scope.three){
        //     $scope.three[i].status=false;
        // }
        $scope.three[index].status=!$scope.three[index].status;
    }
});
//漏油
app.config(function ($stateProvider, $urlRouterProvider) {
    $stateProvider.state("one", {
        url: "/one",
        templateUrl: "dom1.html"
    }).state("one.yi", {
        url: "/one.yi",
        templateUrl: "dom1_a.html",
        controller: "my"
    }).state("one.er", {
        url: "/one.er",
        templateUrl: "dom1_b.html",
        controller: "my"
    }).state("two", {
            url: "/two",
            templateUrl: 'dom2.html',
            controller: "my"
        })
        .state("three", {
            url: "/three",
            templateUrl: 'dom3.html'
        })
    $urlRouterProvider.otherwise('/one.yi')
});

